import { useState } from "react";
function Login() {
    const [username, setUsername] = useState('')
    const [password, setPassword] = useState('')

    const handleLogin = () => {
        if (username !== '' && password !== '') {
            alert('登录成功')
        } else {
            alert('请输入账号或密码')
        }
    }
    return <>
        账号：<input type="text" value={username} onChange={(e) => setUsername(e.target.value)} />
        <br />
        密码：<input type="password" value={password} onChange={(e) => setPassword(e.target.value)} />
        <br />
        <button onClick={handleLogin}>登录</button>
    </>
}

export default Login;